<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>书籍每日明细</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
  <style>
    .layuiadmin-big-font{
      font-size: 25px !important;
      line-height: 25px !important;
    }
    .caller-item {
      padding: 6px 10px;
      overflow: hidden;
    }
    .caller-main p {
      padding: 6px 0;
    }
    .caller-fl{
      float: left;
      position: absolute;
      left: 135px;
      top: 14px;
    }
    .layui-card span[lay-separator] {
      margin: 0 10px;
      color: #999;
      font-weight: bold;
    }

    .brief {
      line-height: 1.5;
      color: #777;
      max-width: 95%;
      height: 61px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      padding-top: 1px !important;
    }


  </style>
</head>
<body>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">

    <div class="layui-col-sm12 layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-body layuiadmin-card-list">

          <div class="caller-item">
            <a style="float: left;" lay-href="/spread/novelInfo.html?id={$novel.id}" lay-text="{$novel.title}">
              <img class="cover" src="__IMG_DOMAIN__{$novel.cover}" width="93.6" height="124.8">
            </a>
            <div class="caller-main caller-fl">
              <p><strong><a lay-href="/spread/novelInfo.html?id={$novel.id}" lay-text="{$novel.title}">{$novel.title}</a></strong>
                {if $novel.update_status != 1}
                <em style="color: #999999;" lay-tips="{$novel.chapter_up_time}" >[更新中]</em>
                {else /}
                <em style="color: #999999;">[已完结]</em>
                {/if}
              </p>
              <p class="caller-adds brief">{$novel.brief|trim}</p>
              <p style="font-weight:300;">{$novel.freq['name']}<span lay-separator="">·</span>{$novel.novel_class['name']}<span lay-separator="">·</span>{$novel.number_words_text}</p>
            </div>
          </div>

        </div>
      </div>
    </div>

    <div class="layui-col-sm12">
      <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12">

          <blockquote class="layui-elem-quote">
            <div class="layui-text">
              <ul>
                <li>数据延时一天统计</li>
                <li>算法：付费率：支付uv / 阅读uv，消费率：消费uv / 阅读uv，人均消费书币：消费书币 / 消费uv，注册充值率：注册并支付 / 注册用户</li>
                <li>人均消费书币越高代表书籍后续越好（前提是消费uv差不多），注册充值率充值率越高代表这本书吸引新用户首充的能力越高（注册用户一致的情况），付费率越高代表这本书的整体吸引充值情况</li>
              </ul>
            </div>
          </blockquote>

          <div class="layui-card">

            <div class="layui-form layui-card-header layuiadmin-card-header-auto">

              <div class="layui-form-item">
                <div class="layui-inline">
                  <input type="text" id="dayStart" name="start_date" placeholder="数据开始时间" autocomplete="off" class="layui-input">
                </div>

                <div class="layui-inline">
                  <input type="text" id="dayEnd" name="end_date" placeholder="数据结束时间" autocomplete="off" class="layui-input">
                </div>

                <div class="layui-inline">
                  <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-user-search">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                  </button>
                </div>


              </div>

            </div>

            <div class="layui-card-body">
              <table id="LAY-user-back-role" lay-filter="LAY-user-back-role"></table>
            </div>
          </div>
        </div>
      </div>
    </div>

  </div>
</div>
</div>

<script src="/static/layuiadmin/layui/layui.js"></script>
<script>
  layui.config({
    base: '/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'sample','table','laydate'],function () {
    var $ = layui.$
            , form = layui.form
            , admin = layui.admin
            , table = layui.table;
    var laydate = layui.laydate;

    form.on('submit(LAY-user-search)', function (data) {
      var field = data.field;

      //执行重载
      table.reload('LAY-user-back-role', {
        where: field
        ,page: {
          curr: 1  // 将页码重置为第一页
        }
      });
    });

    var nowTime = new Date().valueOf();
    var start = laydate.render({
      elem: '#dayStart',
      type: 'date',
      max: nowTime,
      done: function (value, date) {
        endMax = end.config.max;
        end.config.min = date;
        end.config.min.month = date.month - 1;
      }
    });
    var end = laydate.render({
      elem: '#dayEnd',
      type: 'date',
      max: nowTime,
      done: function (value, date) {
        if ($.trim(value) == '') {
          var curDate = new Date();
          date = {
            'date': curDate.getDate(),
            'month': curDate.getMonth() + 1,
            'year': curDate.getFullYear()
          };
        }
        start.config.max = date;
        start.config.max.month = date.month - 1;
      }
    });


    table.render({
      elem: '#LAY-user-back-role'
      , url: '/novel/dataDetail?id={$nid}' //模拟接口
      , response: {
        statusCode: 1 //规定成功的状态码，本来是：0，现在统一改为1
      }
      ,initSort: {
        field: 'read_date' //排序字段，对应 cols 设定的各字段名
        ,type: 'desc'
      }
      ,even: true //开启隔行背景
      , cellMinWidth: 100
      , page: true //开启分页
      , limit: 20
      , limits: [10, 20, 30, 50, 100]
      , cols: [
        [ {field: 'read_date', title: '日期', sort: true,width: 130}
          , {field: 'uv', title: '阅读uv', sort: true}
          , {field: 'pay_uv', title: '支付uv',sort: true, style:'background-color: #eee;'}
          , {field: 'money', title: '充值金额',sort: true, style:'background-color: #eee;'}
          , {field: 'pay_rate', title: '付费率', style:'background-color: #eee;'}
          , {field: 'cuv', title: '消费uv',sort: true, style:'background-color: #BCB;'}
          , {field: 'use_coin', title: '消费书币',sort: true, style:'background-color: #BCB;'}
          , {field: 'c_rate', title: '消费率', style:'background-color: #BCB;'}
          , {field: 'c_rj', title: '人均消费书币', style:'background-color: #BCB;'}
          , {field: 'new_uv', title: '注册用户',sort: true, style:'background-color: #EDC;'}
          , {field: 'new_pay_uv', title: '注册并支付',minWidth: 120,sort: true, style:'background-color: #EDC;'}
          , {field: 'new_rate', title: '注册充值率', style:'background-color: #EDC;'}
          , {field: 'new_money', title: '注册用户当日充值',minWidth: 160,sort: true, style:'background-color: #EDC;'}
         ]]
    });


  });
</script>
</body>
</html>